@extends("admin.public.admin_layout")

@section('body')
    <style>
        .layui-form-label {
            width: 150px;
        }
    </style>
    <blockquote class="site-text layui-elem-quote">
        <p>添加：<em>组织等级标识</em></p>
    </blockquote>
    <div class="layui-row">
        <form class="layui-form">
            @csrf
            <div class="layui-form-item">
                <label class="layui-form-label">上级</label>
                <div class="layui-input-inline">
                    <select name="p_organize_level_num" lay-filter="p_organize_level_num">
                        <option value="0">选择上级组织</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">组织等级名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="organize_level_name" style="width: 300px" placeholder="请输入组织等级名称" autocomplete="off"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">组织等级描述</label>
                <div class="layui-input-inline">
                    <textarea name="organize_level_desc" id="" cols="300" style="width: 600px" placeholder="请输入组织等级名称" rows="10"
                              class="layui-textarea"></textarea>

                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

@endsection

@section('javascript')
    <script>
        layui.use('element', function () {
            var element = layui.element;
            var form = layui.form;
            var table = layui.table;
            var jquery = layui.jquery;

            form.on('submit(submit)', function(data){
                console.log(data.field);
                jquery.post('{{url("admin/organize_level/create")}}', data.field, function (res) {
                    console.log(res);
                });
                return false;
            });
        });

    </script>

@endsection
